package com.jyw.business.ast.domain.vo.web;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jyw.business.ast.domain.AstConsumableClaim;
import com.jyw.common.annotation.Conversion;
import com.jyw.common.enums.ConversionType;
import com.jyw.common.utils.bean.BeanUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;

import java.util.Date;
import java.util.List;

@Data
@ApiModel("资产申领-详情")
@FieldNameConstants
@NoArgsConstructor
public class AstConsumableClaimDetailVo {

    /** 主键 */
    @ApiModelProperty("主键")
    private Long id;

    /** 申请科室 */
    @ApiModelProperty("申请科室")
    @Conversion(value = ConversionType.DEPT,name = Fields.inDeptName)
    private Long inDept;

    @ApiModelProperty("申请科室名称")
    private String inDeptName;

    /** 备注 */
    @ApiModelProperty("备注")
    private String remark;

    /** 审核人 */
    @ApiModelProperty("审核人")
    @Conversion(value = ConversionType.USER,name = Fields.auditUserName)
    private Long auditUser;

    @ApiModelProperty("审核人名称")
    private String auditUserName;

    /** 审核结果(0待审核 1驳回 2通过) */
    @ApiModelProperty("审核结果(0待审核 1驳回 2通过)")
    private String auditState;

    /** 审核备注 */
    @ApiModelProperty("审核备注")
    private String auditRemark;

    /** 申请人 */
    @ApiModelProperty("申请人")
    @Conversion(value = ConversionType.USER,name = Fields.createUserName)
    private Long createUser;

    @ApiModelProperty("申请人名称")
    private String createUserName;

    /** 申请时间 */
    @ApiModelProperty("申请时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("申领资产列表")
    private List<AstConsumableClaimReserveVo> claimReserve;

    public AstConsumableClaimDetailVo(AstConsumableClaim claim, List<AstConsumableClaimReserveVo> claimReserve) {
        BeanUtils.copyProperties(claim,this);
        setClaimReserve(claimReserve);
    }
}
